From 96f8844d3d165eadc9cba55aa91fe2166a496e62 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Sun, 8 May 2005 12:06:10 +0000 Subject: [PATCH] bitkeeper revision 1.1389.5.35 (427e00b2juTv-JMiPdIYinvwaH2N8Q) Field-name cleanups. Signed-off-by: Keir Fraser --- xen/arch/ia64/domain.c | 8 ++-- xen/arch/ia64/idle0_task.c | 2 +- xen/arch/ia64/xenmisc.c | 4 +- xen/arch/ia64/xensetup.c | 2 +- xen/arch/x86/dom0_ops.c | 2 +- xen/arch/x86/domain.c | 16 +++---- xen/arch/x86/domain_build.c | 4 +- xen/arch/x86/i387.c | 6 +-- xen/arch/x86/idle0_task.c | 2 +- xen/arch/x86/mm.c | 12 ++--- xen/arch/x86/physdev.c | 2 +- xen/arch/x86/setup.c | 2 +- xen/arch/x86/shadow.c | 2 +- xen/arch/x86/smpboot.c | 2 +- xen/arch/x86/traps.c | 14 +++--- xen/common/dom0_ops.c | 20 ++++---- xen/common/domain.c | 34 ++++++------- xen/common/event_channel.c | 2 +- xen/common/keyhandler.c | 8 ++-- xen/common/page_alloc.c | 6 +-- xen/common/sched_bvt.c | 68 +++++++++++++------------- xen/common/schedule.c | 51 ++++++++++---------- xen/include/asm-x86/config.h | 4 +- xen/include/asm-x86/debugger.h | 2 +- xen/include/asm-x86/i387.h | 2 +- xen/include/xen/event.h | 2 +- xen/include/xen/sched.h | 87 ++++++++++++++++++---------------- 27 files changed, 186 insertions(+), 180 deletions(-) diff --git a/xen/arch/ia64/domain.c b/xen/arch/ia64/domain.c index 9f0d9d20ba..19a608e1ac 100644 --- a/xen/arch/ia64/domain.c +++ b/xen/arch/ia64/domain.c @@ -626,7 +626,7 @@ int construct_dom0(struct domain *d, #ifndef CLONE_DOMAIN0 if ( d != dom0 ) BUG(); - if ( test_bit(DF_CONSTRUCTED, &d->d_flags) ) + if ( test_bit(DF_CONSTRUCTED, &d->flags) ) BUG(); #endif @@ -753,7 +753,7 @@ int construct_dom0(struct domain *d, #endif console_endboot(strstr(cmdline, "tty0") != NULL); - set_bit(DF_CONSTRUCTED, &d->d_flags); + set_bit(DF_CONSTRUCTED, &d->flags); new_thread(ed, pkern_entry, 0, 0); // FIXME: Hack for keyboard input @@ -783,7 +783,7 @@ int construct_domU(struct domain *d, unsigned long pkern_entry; #ifndef DOMU_AUTO_RESTART - if ( test_bit(DF_CONSTRUCTED, &d->d_flags) ) BUG(); + if ( test_bit(DF_CONSTRUCTED, &d->flags) ) BUG(); #endif printk("*** LOADING DOMAIN %d ***\n",d->id); @@ -816,7 +816,7 @@ int construct_domU(struct domain *d, loaddomainelfimage(d,image_start); printk("loaddomainelfimage returns\n"); - set_bit(DF_CONSTRUCTED, &d->d_flags); + set_bit(DF_CONSTRUCTED, &d->flags); printk("calling new_thread, entry=%p\n",pkern_entry); #ifdef DOMU_AUTO_RESTART diff --git a/xen/arch/ia64/idle0_task.c b/xen/arch/ia64/idle0_task.c index b7523ea502..4bc636ae6e 100644 --- a/xen/arch/ia64/idle0_task.c +++ b/xen/arch/ia64/idle0_task.c @@ -22,7 +22,7 @@ #define IDLE0_DOMAIN(_t) \ { \ id: IDLE_DOMAIN_ID, \ - d_flags: 1<domain->id & 0xf; if (!cnt[id]--) { printk("%x",id); cnt[id] = 50; } if (!i--) { printk("+",id); cnt[id] = 100; } } - clear_bit(EDF_RUNNING, &prev->ed_flags); + clear_bit(EDF_RUNNING, &prev->flags); //if (!is_idle_task(next->domain) ) //send_guest_virq(next, VIRQ_TIMER); load_region_regs(current); @@ -270,7 +270,7 @@ loop: printf(buf); if (regs) show_registers(regs); domain_pause_by_systemcontroller(current->domain); - set_bit(DF_CRASHED, ed->domain->d_flags); + set_bit(DF_CRASHED, ed->domain->flags); if (ed->domain->id == 0) { int i = 1000000000L; // if domain0 crashes, just periodically print out panic diff --git a/xen/arch/ia64/xensetup.c b/xen/arch/ia64/xensetup.c index 7d497ea40c..ec864e1ef2 100644 --- a/xen/arch/ia64/xensetup.c +++ b/xen/arch/ia64/xensetup.c @@ -267,7 +267,7 @@ printk("About to call init_idle_task()\n"); if ( dom0 == NULL ) panic("Error creating domain 0\n"); - set_bit(DF_PRIVILEGED, &dom0->d_flags); + set_bit(DF_PRIVILEGED, &dom0->flags); /* * We're going to setup domain0 using the module(s) that we stashed safely diff --git a/xen/arch/x86/dom0_ops.c b/xen/arch/x86/dom0_ops.c index 722317b698..a3251368ce 100644 --- a/xen/arch/x86/dom0_ops.c +++ b/xen/arch/x86/dom0_ops.c @@ -397,7 +397,7 @@ void arch_getdomaininfo_ctxt( #endif c->flags = 0; - if ( test_bit(EDF_DONEFPUINIT, &ed->ed_flags) ) + if ( test_bit(EDF_DONEFPUINIT, &ed->flags) ) c->flags |= VGCF_I387_VALID; if ( KERNEL_MODE(ed, &ed->arch.guest_context.user_regs) ) c->flags |= VGCF_IN_KERNEL; diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 3d275206b4..a3fdcaf1bf 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -252,7 +252,7 @@ void arch_do_createdomain(struct exec_domain *ed) d->shared_info = (void *)alloc_xenheap_page(); memset(d->shared_info, 0, PAGE_SIZE); - ed->vcpu_info = &d->shared_info->vcpu_data[ed->eid]; + ed->vcpu_info = &d->shared_info->vcpu_data[ed->id]; SHARE_PFN_WITH_DOMAIN(virt_to_page(d->shared_info), d); machine_to_phys_mapping[virt_to_phys(d->shared_info) >> PAGE_SHIFT] = INVALID_M2P_ENTRY; @@ -294,7 +294,7 @@ void arch_do_boot_vcpu(struct exec_domain *ed) struct domain *d = ed->domain; ed->arch.schedule_tail = d->exec_domain[0]->arch.schedule_tail; ed->arch.perdomain_ptes = - d->arch.mm_perdomain_pt + (ed->eid << PDPT_VCPU_SHIFT); + d->arch.mm_perdomain_pt + (ed->id << PDPT_VCPU_SHIFT); ed->arch.flags = TF_kernel_mode; } @@ -397,9 +397,9 @@ int arch_set_info_guest( return -EINVAL; } - clear_bit(EDF_DONEFPUINIT, &ed->ed_flags); + clear_bit(EDF_DONEFPUINIT, &ed->flags); if ( c->flags & VGCF_I387_VALID ) - set_bit(EDF_DONEFPUINIT, &ed->ed_flags); + set_bit(EDF_DONEFPUINIT, &ed->flags); ed->arch.flags &= ~TF_kernel_mode; if ( c->flags & VGCF_IN_KERNEL ) @@ -415,7 +415,7 @@ int arch_set_info_guest( if ( !IS_PRIV(d) ) ed->arch.guest_context.user_regs.eflags &= 0xffffcfff; - if ( test_bit(EDF_DONEINIT, &ed->ed_flags) ) + if ( test_bit(EDF_DONEINIT, &ed->flags) ) return 0; if ( (rc = (int)set_fast_trap(ed, c->fast_trap_idx)) != 0 ) @@ -426,7 +426,7 @@ int arch_set_info_guest( for ( i = 0; i < 8; i++ ) (void)set_debugreg(ed, i, c->debugreg[i]); - if ( ed->eid == 0 ) + if ( ed->id == 0 ) d->vm_assist = c->vm_assist; phys_basetab = c->pt_base; @@ -478,7 +478,7 @@ int arch_set_info_guest( update_pagetables(ed); /* Don't redo final setup */ - set_bit(EDF_DONEINIT, &ed->ed_flags); + set_bit(EDF_DONEINIT, &ed->flags); return 0; } @@ -796,7 +796,7 @@ void context_switch(struct exec_domain *prev, struct exec_domain *next) * 'prev' (after this point, a dying domain's info structure may be freed * without warning). */ - clear_bit(EDF_RUNNING, &prev->ed_flags); + clear_bit(EDF_RUNNING, &prev->flags); schedule_tail(next); BUG(); diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c index 5a82ac60eb..5c650f4688 100644 --- a/xen/arch/x86/domain_build.c +++ b/xen/arch/x86/domain_build.c @@ -114,7 +114,7 @@ int construct_dom0(struct domain *d, /* Sanity! */ if ( d->id != 0 ) BUG(); - if ( test_bit(DF_CONSTRUCTED, &d->d_flags) ) + if ( test_bit(DF_CONSTRUCTED, &d->flags) ) BUG(); memset(&dsi, 0, sizeof(struct domain_setup_info)); @@ -540,7 +540,7 @@ int construct_dom0(struct domain *d, /* DOM0 gets access to everything. */ physdev_init_dom0(d); - set_bit(DF_CONSTRUCTED, &d->d_flags); + set_bit(DF_CONSTRUCTED, &d->flags); new_thread(ed, dsi.v_kernentry, vstack_end, vstartinfo_start); diff --git a/xen/arch/x86/i387.c b/xen/arch/x86/i387.c index 08dc9fdcb7..af54d0af8a 100644 --- a/xen/arch/x86/i387.c +++ b/xen/arch/x86/i387.c @@ -18,7 +18,7 @@ void init_fpu(void) __asm__ __volatile__ ( "fninit" ); if ( cpu_has_xmm ) load_mxcsr(0x1f80); - set_bit(EDF_DONEFPUINIT, ¤t->ed_flags); + set_bit(EDF_DONEFPUINIT, ¤t->flags); } void save_init_fpu(struct exec_domain *tsk) @@ -28,7 +28,7 @@ void save_init_fpu(struct exec_domain *tsk) * This causes us to set the real flag, so we'll need * to temporarily clear it while saving f-p state. */ - if ( test_bit(EDF_GUEST_STTS, &tsk->ed_flags) ) + if ( test_bit(EDF_GUEST_STTS, &tsk->flags) ) clts(); if ( cpu_has_fxsr ) @@ -40,7 +40,7 @@ void save_init_fpu(struct exec_domain *tsk) "fnsave %0 ; fwait" : "=m" (tsk->arch.guest_context.fpu_ctxt) ); - clear_bit(EDF_USEDFPU, &tsk->ed_flags); + clear_bit(EDF_USEDFPU, &tsk->flags); stts(); } diff --git a/xen/arch/x86/idle0_task.c b/xen/arch/x86/idle0_task.c index 71fbc34dd6..43c0c31c25 100644 --- a/xen/arch/x86/idle0_task.c +++ b/xen/arch/x86/idle0_task.c @@ -5,7 +5,7 @@ struct domain idle0_domain = { id: IDLE_DOMAIN_ID, - d_flags: 1<d_flags)); + test_bit(DF_DYING, &page_get_owner(page)->flags)); if ( unlikely((nx & PGT_count_mask) == 0) ) { @@ -1691,13 +1691,13 @@ int do_mmuext_op( * it is dying. */ ASSERT(e->tot_pages <= e->max_pages); - if ( unlikely(test_bit(DF_DYING, &e->d_flags)) || + if ( unlikely(test_bit(DF_DYING, &e->flags)) || unlikely(e->tot_pages == e->max_pages) || unlikely(IS_XEN_HEAP_FRAME(page)) ) { MEM_LOG("Transferee has no reservation headroom (%d,%d), or " "page is in Xen heap (%lx), or dom is dying (%ld).\n", - e->tot_pages, e->max_pages, op.mfn, e->d_flags); + e->tot_pages, e->max_pages, op.mfn, e->flags); okay = 0; goto reassign_fail; } @@ -2776,7 +2776,7 @@ int ptwr_do_page_fault(struct domain *d, unsigned long addr) * If this is a multi-processor guest then ensure that the page is hooked * into at most one L2 table, which must be the one running on this VCPU. */ - if ( (d->exec_domain[0]->ed_next_list != NULL) && + if ( (d->exec_domain[0]->next_in_list != NULL) && ((page->u.inuse.type_info & PGT_count_mask) != (!!(page->u.inuse.type_info & PGT_pinned) + (which == PTWR_PT_ACTIVE))) ) @@ -2945,13 +2945,13 @@ void ptwr_destroy(struct domain *d) * Also, a domain mustn't have PGC_allocated pages when it is dying. */ ASSERT(e->tot_pages <= e->max_pages); - if ( unlikely(test_bit(DF_DYING, &e->d_flags)) || + if ( unlikely(test_bit(DF_DYING, &e->flags)) || unlikely(e->tot_pages == e->max_pages) || unlikely(!gnttab_prepare_for_transfer(e, d, gntref)) ) { MEM_LOG("Transferee has no reservation headroom (%d,%d), or " "provided a bad grant ref, or is dying (%p).\n", - e->tot_pages, e->max_pages, e->d_flags); + e->tot_pages, e->max_pages, e->flags); spin_unlock(&e->page_alloc_lock); put_domain(e); okay = 0; diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c index 9e47826998..66e0ed1251 100644 --- a/xen/arch/x86/physdev.c +++ b/xen/arch/x86/physdev.c @@ -130,7 +130,7 @@ void physdev_init_dom0(struct domain *d) BUG_ON(d->arch.iobmp_mask == NULL); memset(d->arch.iobmp_mask, 0, IOBMP_BYTES); - set_bit(DF_PHYSDEV, &d->d_flags); + set_bit(DF_PHYSDEV, &d->flags); } diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index 8b8f8182e0..37cc2c4684 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -581,7 +581,7 @@ void __init __start_xen(multiboot_info_t *mbi) if ( dom0 == NULL ) panic("Error creating domain 0\n"); - set_bit(DF_PRIVILEGED, &dom0->d_flags); + set_bit(DF_PRIVILEGED, &dom0->flags); /* Grab the DOM0 command line. Skip past the image name. */ cmdline = (char *)(mod[0].string ? __va(mod[0].string) : NULL); diff --git a/xen/arch/x86/shadow.c b/xen/arch/x86/shadow.c index 3651d9c9aa..6d8a849005 100644 --- a/xen/arch/x86/shadow.c +++ b/xen/arch/x86/shadow.c @@ -1120,7 +1120,7 @@ void __shadow_mode_disable(struct domain *d) * Currently this does not fix up page ref counts, so it is valid to call * only when a domain is being destroyed. */ - BUG_ON(!test_bit(DF_DYING, &d->d_flags)); + BUG_ON(!test_bit(DF_DYING, &d->flags)); d->arch.shadow_tainted_refcnts = 1; free_shadow_pages(d); diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c index a992045be2..981a36d97d 100644 --- a/xen/arch/x86/smpboot.c +++ b/xen/arch/x86/smpboot.c @@ -658,7 +658,7 @@ static void __init do_boot_cpu (int apicid) ed = idle->exec_domain[0]; - set_bit(DF_IDLETASK, &idle->d_flags); + set_bit(DF_IDLETASK, &idle->flags); ed->arch.monitor_table = mk_pagetable(__pa(idle_pg_table)); diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index 3c5cc07c0c..f242333c8d 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -361,13 +361,13 @@ long do_fpu_taskswitch(int set) if ( set ) { - set_bit(EDF_GUEST_STTS, &ed->ed_flags); + set_bit(EDF_GUEST_STTS, &ed->flags); stts(); } else { - clear_bit(EDF_GUEST_STTS, &ed->ed_flags); - if ( test_bit(EDF_USEDFPU, &ed->ed_flags) ) + clear_bit(EDF_GUEST_STTS, &ed->flags); + if ( test_bit(EDF_USEDFPU, &ed->flags) ) clts(); } @@ -665,7 +665,7 @@ static int emulate_privileged_op(struct cpu_user_regs *regs) case 0: /* Read CR0 */ *reg = (read_cr0() & ~X86_CR0_TS) | - (test_bit(EDF_GUEST_STTS, &ed->ed_flags) ? X86_CR0_TS : 0); + (test_bit(EDF_GUEST_STTS, &ed->flags) ? X86_CR0_TS : 0); break; case 2: /* Read CR2 */ @@ -919,15 +919,15 @@ asmlinkage int math_state_restore(struct cpu_user_regs *regs) /* Prevent recursion. */ clts(); - if ( !test_and_set_bit(EDF_USEDFPU, ¤t->ed_flags) ) + if ( !test_and_set_bit(EDF_USEDFPU, ¤t->flags) ) { - if ( test_bit(EDF_DONEFPUINIT, ¤t->ed_flags) ) + if ( test_bit(EDF_DONEFPUINIT, ¤t->flags) ) restore_fpu(current); else init_fpu(); } - if ( test_and_clear_bit(EDF_GUEST_STTS, ¤t->ed_flags) ) + if ( test_and_clear_bit(EDF_GUEST_STTS, ¤t->flags) ) { struct trap_bounce *tb = ¤t->arch.trap_bounce; tb->flags = TBF_EXCEPTION; diff --git a/xen/common/dom0_ops.c b/xen/common/dom0_ops.c index 750eb14813..23fc589d4d 100644 --- a/xen/common/dom0_ops.c +++ b/xen/common/dom0_ops.c @@ -139,7 +139,7 @@ long do_dom0_op(dom0_op_t *u_dom0_op) { ret = -EINVAL; if ( (d != current->domain) && - test_bit(DF_CONSTRUCTED, &d->d_flags) ) + test_bit(DF_CONSTRUCTED, &d->flags) ) { domain_unpause_by_systemcontroller(d); ret = 0; @@ -246,14 +246,14 @@ long do_dom0_op(dom0_op_t *u_dom0_op) if ( cpu == -1 ) { - clear_bit(EDF_CPUPINNED, &ed->ed_flags); + clear_bit(EDF_CPUPINNED, &ed->flags); } else { exec_domain_pause(ed); if ( ed->processor != (cpu % smp_num_cpus) ) - set_bit(EDF_MIGRATED, &ed->ed_flags); - set_bit(EDF_CPUPINNED, &ed->ed_flags); + set_bit(EDF_MIGRATED, &ed->flags); + set_bit(EDF_CPUPINNED, &ed->flags); ed->processor = cpu % smp_num_cpus; exec_domain_unpause(ed); } @@ -311,12 +311,12 @@ long do_dom0_op(dom0_op_t *u_dom0_op) ed = d->exec_domain[op->u.getdomaininfo.exec_domain]; op->u.getdomaininfo.flags = - (test_bit( DF_DYING, &d->d_flags) ? DOMFLAGS_DYING : 0) | - (test_bit( DF_CRASHED, &d->d_flags) ? DOMFLAGS_CRASHED : 0) | - (test_bit( DF_SHUTDOWN, &d->d_flags) ? DOMFLAGS_SHUTDOWN : 0) | - (test_bit(EDF_CTRLPAUSE, &ed->ed_flags) ? DOMFLAGS_PAUSED : 0) | - (test_bit(EDF_BLOCKED, &ed->ed_flags) ? DOMFLAGS_BLOCKED : 0) | - (test_bit(EDF_RUNNING, &ed->ed_flags) ? DOMFLAGS_RUNNING : 0); + (test_bit( DF_DYING, &d->flags) ? DOMFLAGS_DYING : 0) | + (test_bit( DF_CRASHED, &d->flags) ? DOMFLAGS_CRASHED : 0) | + (test_bit( DF_SHUTDOWN, &d->flags) ? DOMFLAGS_SHUTDOWN : 0) | + (test_bit(EDF_CTRLPAUSE, &ed->flags) ? DOMFLAGS_PAUSED : 0) | + (test_bit(EDF_BLOCKED, &ed->flags) ? DOMFLAGS_BLOCKED : 0) | + (test_bit(EDF_RUNNING, &ed->flags) ? DOMFLAGS_RUNNING : 0); op->u.getdomaininfo.flags |= ed->processor << DOMFLAGS_CPUSHIFT; op->u.getdomaininfo.flags |= diff --git a/xen/common/domain.c b/xen/common/domain.c index 253a6b102b..7ab17768c6 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -66,12 +66,12 @@ struct domain *do_createdomain(domid_t dom_id, unsigned int cpu) { write_lock(&domlist_lock); pd = &domain_list; /* NB. domain_list maintained in order of dom_id. */ - for ( pd = &domain_list; *pd != NULL; pd = &(*pd)->next_list ) + for ( pd = &domain_list; *pd != NULL; pd = &(*pd)->next_in_list ) if ( (*pd)->id > d->id ) break; - d->next_list = *pd; + d->next_in_list = *pd; *pd = d; - d->next_hash = domain_hash[DOMAIN_HASH(dom_id)]; + d->next_in_hashbucket = domain_hash[DOMAIN_HASH(dom_id)]; domain_hash[DOMAIN_HASH(dom_id)] = d; write_unlock(&domlist_lock); } @@ -94,7 +94,7 @@ struct domain *find_domain_by_id(domid_t dom) d = NULL; break; } - d = d->next_hash; + d = d->next_in_hashbucket; } read_unlock(&domlist_lock); @@ -107,7 +107,7 @@ void domain_kill(struct domain *d) struct exec_domain *ed; domain_pause(d); - if ( !test_and_set_bit(DF_DYING, &d->d_flags) ) + if ( !test_and_set_bit(DF_DYING, &d->flags) ) { for_each_exec_domain(d, ed) sched_rem_domain(ed); @@ -124,7 +124,7 @@ void domain_crash(void) if ( d->id == 0 ) BUG(); - set_bit(DF_CRASHED, &d->d_flags); + set_bit(DF_CRASHED, &d->flags); send_guest_virq(dom0->exec_domain[0], VIRQ_DOM_EXC); @@ -164,9 +164,9 @@ void domain_shutdown(u8 reason) } if ( (d->shutdown_code = reason) == SHUTDOWN_crash ) - set_bit(DF_CRASHED, &d->d_flags); + set_bit(DF_CRASHED, &d->flags); else - set_bit(DF_SHUTDOWN, &d->d_flags); + set_bit(DF_SHUTDOWN, &d->flags); send_guest_virq(dom0->exec_domain[0], VIRQ_DOM_EXC); @@ -180,7 +180,7 @@ void domain_destruct(struct domain *d) struct domain **pd; atomic_t old, new; - if ( !test_bit(DF_DYING, &d->d_flags) ) + if ( !test_bit(DF_DYING, &d->flags) ) BUG(); /* May be already destructed, or get_domain() can race us. */ @@ -194,12 +194,12 @@ void domain_destruct(struct domain *d) write_lock(&domlist_lock); pd = &domain_list; while ( *pd != d ) - pd = &(*pd)->next_list; - *pd = d->next_list; + pd = &(*pd)->next_in_list; + *pd = d->next_in_list; pd = &domain_hash[DOMAIN_HASH(d->id)]; while ( *pd != d ) - pd = &(*pd)->next_hash; - *pd = d->next_hash; + pd = &(*pd)->next_in_hashbucket; + *pd = d->next_in_hashbucket; write_unlock(&domlist_lock); destroy_event_channels(d); @@ -227,8 +227,8 @@ int set_info_guest(struct domain *p, dom0_setdomaininfo_t *setdomaininfo) if ( (vcpu >= MAX_VIRT_CPUS) || ((ed = p->exec_domain[vcpu]) == NULL) ) return -EINVAL; - if (test_bit(DF_CONSTRUCTED, &p->d_flags) && - !test_bit(EDF_CTRLPAUSE, &ed->ed_flags)) + if (test_bit(DF_CONSTRUCTED, &p->flags) && + !test_bit(EDF_CTRLPAUSE, &ed->flags)) return -EINVAL; if ( (c = xmalloc(struct vcpu_guest_context)) == NULL ) @@ -243,7 +243,7 @@ int set_info_guest(struct domain *p, dom0_setdomaininfo_t *setdomaininfo) if ( (rc = arch_set_info_guest(ed, c)) != 0 ) goto out; - set_bit(DF_CONSTRUCTED, &p->d_flags); + set_bit(DF_CONSTRUCTED, &p->flags); out: xfree(c); @@ -294,7 +294,7 @@ long do_boot_vcpu(unsigned long vcpu, struct vcpu_guest_context *ctxt) sched_add_domain(ed); /* domain_unpause_by_systemcontroller */ - if ( test_and_clear_bit(EDF_CTRLPAUSE, &ed->ed_flags) ) + if ( test_and_clear_bit(EDF_CTRLPAUSE, &ed->flags) ) domain_wake(ed); xfree(c); diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c index b1ed16ac37..22b01ad541 100644 --- a/xen/common/event_channel.c +++ b/xen/common/event_channel.c @@ -40,7 +40,7 @@ static int get_free_port(struct exec_domain *ed) max = d->max_event_channel; chn = d->event_channel; - for ( port = ed->eid * EVENT_CHANNELS_SPREAD; port < max; port++ ) + for ( port = ed->id * EVENT_CHANNELS_SPREAD; port < max; port++ ) if ( chn[port].state == ECS_FREE ) break; diff --git a/xen/common/keyhandler.c b/xen/common/keyhandler.c index ca43f2f3c3..3449143458 100644 --- a/xen/common/keyhandler.c +++ b/xen/common/keyhandler.c @@ -109,7 +109,7 @@ static void do_task_queues(unsigned char key) for_each_domain ( d ) { printk("Xen: DOM %u, flags=%lx refcnt=%d nr_pages=%d " - "xenheap_pages=%d\n", d->id, d->d_flags, + "xenheap_pages=%d\n", d->id, d->flags, atomic_read(&d->refcnt), d->tot_pages, d->xenheap_pages); dump_pageframe_info(d); @@ -118,11 +118,11 @@ static void do_task_queues(unsigned char key) printk("Guest: %p CPU %d [has=%c] flags=%lx " "upcall_pend = %02x, upcall_mask = %02x\n", ed, ed->processor, - test_bit(EDF_RUNNING, &ed->ed_flags) ? 'T':'F', - ed->ed_flags, + test_bit(EDF_RUNNING, &ed->flags) ? 'T':'F', + ed->flags, ed->vcpu_info->evtchn_upcall_pending, ed->vcpu_info->evtchn_upcall_mask); - printk("Notifying guest... %d/%d\n", d->id, ed->eid); + printk("Notifying guest... %d/%d\n", d->id, ed->id); printk("port %d/%d stat %d %d %d\n", VIRQ_DEBUG, ed->virq_to_evtchn[VIRQ_DEBUG], test_bit(ed->virq_to_evtchn[VIRQ_DEBUG], diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index 5573ced957..fb26edc69c 100644 --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -503,13 +503,13 @@ struct pfn_info *alloc_domheap_pages(struct domain *d, unsigned int order) spin_lock(&d->page_alloc_lock); - if ( unlikely(test_bit(DF_DYING, &d->d_flags)) || + if ( unlikely(test_bit(DF_DYING, &d->flags)) || unlikely((d->tot_pages + (1 << order)) > d->max_pages) ) { DPRINTK("Over-allocation for domain %u: %u > %u\n", d->id, d->tot_pages + (1 << order), d->max_pages); DPRINTK("...or the domain is dying (%d)\n", - !!test_bit(DF_DYING, &d->d_flags)); + !!test_bit(DF_DYING, &d->flags)); spin_unlock(&d->page_alloc_lock); free_heap_pages(MEMZONE_DOM, pg, order); return NULL; @@ -574,7 +574,7 @@ void free_domheap_pages(struct pfn_info *pg, unsigned int order) spin_unlock_recursive(&d->page_alloc_lock); - if ( likely(!test_bit(DF_DYING, &d->d_flags)) ) + if ( likely(!test_bit(DF_DYING, &d->flags)) ) { free_heap_pages(MEMZONE_DOM, pg, order); } diff --git a/xen/common/sched_bvt.c b/xen/common/sched_bvt.c index 65fa6125bf..276479e490 100644 --- a/xen/common/sched_bvt.c +++ b/xen/common/sched_bvt.c @@ -59,7 +59,7 @@ struct bvt_cpu_info }; #define BVT_INFO(p) ((struct bvt_dom_info *)(p)->sched_priv) -#define EBVT_INFO(p) ((struct bvt_edom_info *)(p)->ed_sched_priv) +#define EBVT_INFO(p) ((struct bvt_edom_info *)(p)->sched_priv) #define CPU_INFO(cpu) ((struct bvt_cpu_info *)(schedule_data[cpu]).sched_priv) #define RUNLIST(p) ((struct list_head *)&(EBVT_INFO(p)->run_list)) #define RUNQUEUE(cpu) ((struct list_head *)&(CPU_INFO(cpu)->runqueue)) @@ -174,9 +174,9 @@ static int bvt_alloc_task(struct exec_domain *ed) return -1; memset(d->sched_priv, 0, sizeof(struct bvt_dom_info)); } - ed->ed_sched_priv = &BVT_INFO(d)->ed_inf[ed->eid]; - BVT_INFO(d)->ed_inf[ed->eid].inf = BVT_INFO(d); - BVT_INFO(d)->ed_inf[ed->eid].exec_domain = ed; + ed->sched_priv = &BVT_INFO(d)->ed_inf[ed->id]; + BVT_INFO(d)->ed_inf[ed->id].inf = BVT_INFO(d); + BVT_INFO(d)->ed_inf[ed->id].exec_domain = ed; return 0; } @@ -190,7 +190,7 @@ static void bvt_add_task(struct exec_domain *d) ASSERT(inf != NULL); ASSERT(d != NULL); - if (d->eid == 0) { + if (d->id == 0) { inf->mcu_advance = MCU_ADVANCE; inf->domain = d->domain; inf->warpback = 0; @@ -224,43 +224,43 @@ static void bvt_add_task(struct exec_domain *d) } } -static int bvt_init_idle_task(struct exec_domain *p) +static int bvt_init_idle_task(struct exec_domain *ed) { - if ( bvt_alloc_task(p) < 0 ) + if ( bvt_alloc_task(ed) < 0 ) return -1; - bvt_add_task(p); + bvt_add_task(ed); + + set_bit(EDF_RUNNING, &ed->flags); + if ( !__task_on_runqueue(ed) ) + __add_to_runqueue_head(ed); - set_bit(EDF_RUNNING, &p->ed_flags); - if ( !__task_on_runqueue(p) ) - __add_to_runqueue_head(p); - return 0; } -static void bvt_wake(struct exec_domain *d) +static void bvt_wake(struct exec_domain *ed) { - struct bvt_edom_info *einf = EBVT_INFO(d); + struct bvt_edom_info *einf = EBVT_INFO(ed); struct exec_domain *curr; s_time_t now, r_time; - int cpu = d->processor; + int cpu = ed->processor; u32 curr_evt; - if ( unlikely(__task_on_runqueue(d)) ) + if ( unlikely(__task_on_runqueue(ed)) ) return; - __add_to_runqueue_head(d); + __add_to_runqueue_head(ed); now = NOW(); /* Set the BVT parameters. AVT should always be updated if CPU migration ocurred.*/ if ( einf->avt < CPU_SVT(cpu) || - unlikely(test_bit(EDF_MIGRATED, &d->ed_flags)) ) + unlikely(test_bit(EDF_MIGRATED, &ed->flags)) ) einf->avt = CPU_SVT(cpu); /* Deal with warping here. */ - einf->evt = calc_evt(d, einf->avt); + einf->evt = calc_evt(ed, einf->avt); curr = schedule_data[cpu].curr; curr_evt = calc_evt(curr, calc_avt(curr, now)); @@ -277,12 +277,12 @@ static void bvt_wake(struct exec_domain *d) } -static void bvt_sleep(struct exec_domain *d) +static void bvt_sleep(struct exec_domain *ed) { - if ( test_bit(EDF_RUNNING, &d->ed_flags) ) - cpu_raise_softirq(d->processor, SCHEDULE_SOFTIRQ); - else if ( __task_on_runqueue(d) ) - __del_from_runqueue(d); + if ( test_bit(EDF_RUNNING, &ed->flags) ) + cpu_raise_softirq(ed->processor, SCHEDULE_SOFTIRQ); + else if ( __task_on_runqueue(ed) ) + __del_from_runqueue(ed); } /** @@ -377,7 +377,7 @@ static struct task_slice bvt_do_schedule(s_time_t now) struct bvt_edom_info *next_prime_einf = NULL; struct task_slice ret; - ASSERT(prev->ed_sched_priv != NULL); + ASSERT(prev->sched_priv != NULL); ASSERT(prev_einf != NULL); ASSERT(__task_on_runqueue(prev)); @@ -526,8 +526,8 @@ static void bvt_dump_cpu_state(int i) { struct list_head *queue; int loop = 0; - struct bvt_edom_info *d_inf; - struct exec_domain *d; + struct bvt_edom_info *ed_inf; + struct exec_domain *ed; printk("svt=0x%08lX ", CPU_SVT(i)); @@ -535,15 +535,15 @@ static void bvt_dump_cpu_state(int i) printk("QUEUE rq %lx n: %lx, p: %lx\n", (unsigned long)queue, (unsigned long) queue->next, (unsigned long) queue->prev); - list_for_each_entry ( d_inf, queue, run_list ) + list_for_each_entry ( ed_inf, queue, run_list ) { - d = d_inf->exec_domain; - printk("%3d: %u has=%c ", loop++, d->domain->id, - test_bit(EDF_RUNNING, &d->ed_flags) ? 'T':'F'); - bvt_dump_runq_el(d); - printk("c=0x%X%08X\n", (u32)(d->cpu_time>>32), (u32)d->cpu_time); + ed = ed_inf->exec_domain; + printk("%3d: %u has=%c ", loop++, ed->domain->id, + test_bit(EDF_RUNNING, &ed->flags) ? 'T':'F'); + bvt_dump_runq_el(ed); + printk("c=0x%X%08X\n", (u32)(ed->cpu_time>>32), (u32)ed->cpu_time); printk(" l: %p n: %p p: %p\n", - &d_inf->run_list, d_inf->run_list.next, d_inf->run_list.prev); + &ed_inf->run_list, ed_inf->run_list.next, ed_inf->run_list.prev); } } diff --git a/xen/common/schedule.c b/xen/common/schedule.c index 4123231dd1..b08e09094c 100644 --- a/xen/common/schedule.c +++ b/xen/common/schedule.c @@ -93,24 +93,27 @@ struct exec_domain *alloc_exec_domain_struct(struct domain *d, d->exec_domain[vcpu] = ed; ed->domain = d; - ed->eid = vcpu; + ed->id = vcpu; if ( SCHED_OP(alloc_task, ed) < 0 ) goto out; - if (vcpu != 0) { - ed->vcpu_info = &d->shared_info->vcpu_data[ed->eid]; + if ( vcpu != 0 ) + { + ed->vcpu_info = &d->shared_info->vcpu_data[ed->id]; - for_each_exec_domain(d, edc) { - if (edc->ed_next_list == NULL || edc->ed_next_list->eid > vcpu) + for_each_exec_domain( d, edc ) + { + if ( (edc->next_in_list == NULL) || + (edc->next_in_list->id > vcpu) ) break; } - ed->ed_next_list = edc->ed_next_list; - edc->ed_next_list = ed; + ed->next_in_list = edc->next_in_list; + edc->next_in_list = ed; - if (test_bit(EDF_CPUPINNED, &edc->ed_flags)) { + if (test_bit(EDF_CPUPINNED, &edc->flags)) { ed->processor = (edc->processor + 1) % smp_num_cpus; - set_bit(EDF_CPUPINNED, &ed->ed_flags); + set_bit(EDF_CPUPINNED, &ed->flags); } else { ed->processor = (edc->processor + 1) % smp_num_cpus; /* XXX */ } @@ -152,7 +155,7 @@ void sched_add_domain(struct exec_domain *ed) struct domain *d = ed->domain; /* Must be unpaused by control software to start execution. */ - set_bit(EDF_CTRLPAUSE, &ed->ed_flags); + set_bit(EDF_CTRLPAUSE, &ed->flags); if ( d->id != IDLE_DOMAIN_ID ) { @@ -168,14 +171,14 @@ void sched_add_domain(struct exec_domain *ed) } SCHED_OP(add_task, ed); - TRACE_2D(TRC_SCHED_DOM_ADD, d->id, ed->eid); + TRACE_2D(TRC_SCHED_DOM_ADD, d->id, ed->id); } void sched_rem_domain(struct exec_domain *ed) { rem_ac_timer(&ed->timer); SCHED_OP(rem_task, ed); - TRACE_2D(TRC_SCHED_DOM_REM, ed->domain->id, ed->eid); + TRACE_2D(TRC_SCHED_DOM_REM, ed->domain->id, ed->id); } void init_idle_task(void) @@ -193,10 +196,10 @@ void domain_sleep(struct exec_domain *ed) SCHED_OP(sleep, ed); spin_unlock_irqrestore(&schedule_data[ed->processor].schedule_lock, flags); - TRACE_2D(TRC_SCHED_SLEEP, ed->domain->id, ed->eid); + TRACE_2D(TRC_SCHED_SLEEP, ed->domain->id, ed->id); /* Synchronous. */ - while ( test_bit(EDF_RUNNING, &ed->ed_flags) && !domain_runnable(ed) ) + while ( test_bit(EDF_RUNNING, &ed->flags) && !domain_runnable(ed) ) cpu_relax(); } @@ -212,10 +215,10 @@ void domain_wake(struct exec_domain *ed) ed->wokenup = NOW(); #endif } - clear_bit(EDF_MIGRATED, &ed->ed_flags); + clear_bit(EDF_MIGRATED, &ed->flags); spin_unlock_irqrestore(&schedule_data[ed->processor].schedule_lock, flags); - TRACE_2D(TRC_SCHED_WAKE, ed->domain->id, ed->eid); + TRACE_2D(TRC_SCHED_WAKE, ed->domain->id, ed->id); } /* Block the currently-executing domain until a pertinent event occurs. */ @@ -224,16 +227,16 @@ long do_block(void) struct exec_domain *ed = current; ed->vcpu_info->evtchn_upcall_mask = 0; - set_bit(EDF_BLOCKED, &ed->ed_flags); + set_bit(EDF_BLOCKED, &ed->flags); /* Check for events /after/ blocking: avoids wakeup waiting race. */ if ( event_pending(ed) ) { - clear_bit(EDF_BLOCKED, &ed->ed_flags); + clear_bit(EDF_BLOCKED, &ed->flags); } else { - TRACE_2D(TRC_SCHED_BLOCK, ed->domain->id, ed->eid); + TRACE_2D(TRC_SCHED_BLOCK, ed->domain->id, ed->id); __enter_scheduler(); } @@ -243,7 +246,7 @@ long do_block(void) /* Voluntarily yield the processor for this allocation. */ static long do_yield(void) { - TRACE_2D(TRC_SCHED_YIELD, current->domain->id, current->eid); + TRACE_2D(TRC_SCHED_YIELD, current->domain->id, current->id); __enter_scheduler(); return 0; } @@ -272,7 +275,7 @@ long do_sched_op(unsigned long op) case SCHEDOP_shutdown: { - TRACE_3D(TRC_SCHED_SHUTDOWN, current->domain->id, current->eid, + TRACE_3D(TRC_SCHED_SHUTDOWN, current->domain->id, current->id, (op >> SCHEDOP_reasonshift)); domain_shutdown((u8)(op >> SCHEDOP_reasonshift)); break; @@ -379,7 +382,7 @@ static void __enter_scheduler(void) add_ac_timer(&schedule_data[cpu].s_timer); /* Must be protected by the schedule_lock! */ - set_bit(EDF_RUNNING, &next->ed_flags); + set_bit(EDF_RUNNING, &next->flags); spin_unlock_irq(&schedule_data[cpu].schedule_lock); @@ -417,8 +420,8 @@ static void __enter_scheduler(void) } TRACE_4D(TRC_SCHED_SWITCH, - prev->domain->id, prev->eid, - next->domain->id, next->eid); + prev->domain->id, prev->id, + next->domain->id, next->id); context_switch(prev, next); } diff --git a/xen/include/asm-x86/config.h b/xen/include/asm-x86/config.h index fabe304155..7f44c5ae87 100644 --- a/xen/include/asm-x86/config.h +++ b/xen/include/asm-x86/config.h @@ -271,9 +271,9 @@ extern unsigned long _end; /* standard ELF symbol */ extern unsigned long xenheap_phys_end; /* user-configurable */ #endif -#define GDT_VIRT_START(ed) (PERDOMAIN_VIRT_START + ((ed)->eid << PDPT_VCPU_VA_SHIFT)) +#define GDT_VIRT_START(ed) (PERDOMAIN_VIRT_START + ((ed)->id << PDPT_VCPU_VA_SHIFT)) #define GDT_VIRT_END(ed) (GDT_VIRT_START(ed) + (64*1024)) -#define LDT_VIRT_START(ed) (PERDOMAIN_VIRT_START + (64*1024) + ((ed)->eid << PDPT_VCPU_VA_SHIFT)) +#define LDT_VIRT_START(ed) (PERDOMAIN_VIRT_START + (64*1024) + ((ed)->id << PDPT_VCPU_VA_SHIFT)) #define LDT_VIRT_END(ed) (LDT_VIRT_START(ed) + (64*1024)) #define PDPT_VCPU_SHIFT 5 diff --git a/xen/include/asm-x86/debugger.h b/xen/include/asm-x86/debugger.h index 0d6221a25e..6e9cf223d5 100644 --- a/xen/include/asm-x86/debugger.h +++ b/xen/include/asm-x86/debugger.h @@ -69,7 +69,7 @@ static inline int debugger_trap_entry( { case TRAP_int3: case TRAP_debug: - set_bit(EDF_CTRLPAUSE, &ed->ed_flags); + set_bit(EDF_CTRLPAUSE, &ed->flags); raise_softirq(SCHEDULE_SOFTIRQ); return 1; } diff --git a/xen/include/asm-x86/i387.h b/xen/include/asm-x86/i387.h index 9f6bb78b90..ca81778089 100644 --- a/xen/include/asm-x86/i387.h +++ b/xen/include/asm-x86/i387.h @@ -19,7 +19,7 @@ extern void save_init_fpu(struct exec_domain *tsk); extern void restore_fpu(struct exec_domain *tsk); #define unlazy_fpu(_tsk) do { \ - if ( test_bit(EDF_USEDFPU, &(_tsk)->ed_flags) ) \ + if ( test_bit(EDF_USEDFPU, &(_tsk)->flags) ) \ save_init_fpu(_tsk); \ } while ( 0 ) diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h index f0f3d61fd6..ac7ce6b1a0 100644 --- a/xen/include/xen/event.h +++ b/xen/include/xen/event.h @@ -43,7 +43,7 @@ static inline void evtchn_set_pending(struct exec_domain *ed, int port) * NB2. We save DF_RUNNING across the unblock to avoid a needless * IPI for domains that we IPI'd to unblock. */ - running = test_bit(EDF_RUNNING, &ed->ed_flags); + running = test_bit(EDF_RUNNING, &ed->flags); exec_domain_unblock(ed); if ( running ) smp_send_event_check_cpu(ed->processor); diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index 266e34e8ec..6f64e0c057 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -60,13 +60,14 @@ int init_exec_domain_event_channels(struct exec_domain *ed); struct exec_domain { - u32 processor; + int id; - vcpu_info_t *vcpu_info; + int processor; - struct domain *domain; - struct exec_domain *ed_next_list; - int eid; + vcpu_info_t *vcpu_info; + + struct domain *domain; + struct exec_domain *next_in_list; struct ac_timer timer; /* one-shot timer for timeout values */ unsigned long sleep_tick; /* tick at which this vcpu started sleep */ @@ -75,13 +76,13 @@ struct exec_domain s_time_t lastdeschd; /* time this domain was last descheduled */ s_time_t cpu_time; /* total CPU time received till now */ s_time_t wokenup; /* time domain got woken up */ - void *ed_sched_priv; /* scheduler-specific data */ + void *sched_priv; /* scheduler-specific data */ - unsigned long ed_flags; + unsigned long flags; - u16 virq_to_evtchn[NR_VIRQS]; + u16 virq_to_evtchn[NR_VIRQS]; - atomic_t pausecnt; + atomic_t pausecnt; struct arch_exec_domain arch; }; @@ -111,14 +112,15 @@ struct domain int shutdown_code; /* code value from OS (if DF_SHUTDOWN). */ void *sched_priv; /* scheduler-specific data */ - struct domain *next_list, *next_hash; + struct domain *next_in_list; + struct domain *next_in_hashbucket; /* Event channel information. */ event_channel_t *event_channel; unsigned int max_event_channel; spinlock_t event_channel_lock; - grant_table_t *grant_table; + grant_table_t *grant_table; /* * Interrupt to event-channel mappings. Updates should be protected by the @@ -126,13 +128,13 @@ struct domain * the lock, but races don't usually matter. */ #define NR_PIRQS 128 /* Put this somewhere sane! */ - u16 pirq_to_evtchn[NR_PIRQS]; - u32 pirq_mask[NR_PIRQS/32]; + u16 pirq_to_evtchn[NR_PIRQS]; + u32 pirq_mask[NR_PIRQS/32]; - unsigned long d_flags; - unsigned long vm_assist; + unsigned long flags; + unsigned long vm_assist; - atomic_t refcnt; + atomic_t refcnt; struct exec_domain *exec_domain[MAX_VIRT_CPUS]; @@ -166,7 +168,7 @@ extern struct exec_domain idle0_exec_domain; extern struct exec_domain *idle_task[NR_CPUS]; #define IDLE_DOMAIN_ID (0x7FFFU) -#define is_idle_task(_p) (test_bit(DF_IDLETASK, &(_p)->d_flags)) +#define is_idle_task(_p) (test_bit(DF_IDLETASK, &(_p)->flags)) struct exec_domain *alloc_exec_domain_struct(struct domain *d, unsigned long vcpu); @@ -315,35 +317,36 @@ extern struct domain *domain_hash[DOMAIN_HASH_SIZE]; extern struct domain *domain_list; #define for_each_domain(_d) \ - for ( (_d) = domain_list; (_d) != NULL; (_d) = (_d)->next_list ) + for ( (_d) = domain_list; (_d) != NULL; (_d) = (_d)->next_in_list ) #define for_each_exec_domain(_d,_ed) \ for ( (_ed) = (_d)->exec_domain[0]; \ (_ed) != NULL; \ - (_ed) = (_ed)->ed_next_list ) + (_ed) = (_ed)->next_in_list ) #define EDF_DONEFPUINIT 0 /* Has the FPU been initialised for this task? */ #define EDF_USEDFPU 1 /* Has this task used the FPU since last save? */ #define EDF_GUEST_STTS 2 /* Has the guest OS requested 'stts'? */ -#define DF_CONSTRUCTED 3 /* Has the guest OS been fully built yet? */ -#define DF_IDLETASK 4 /* Is this one of the per-CPU idle domains? */ -#define DF_PRIVILEGED 5 /* Is this domain privileged? */ -#define DF_PHYSDEV 6 /* May this domain do IO to physical devices? */ -#define EDF_BLOCKED 7 /* Domain is blocked waiting for an event. */ -#define EDF_CTRLPAUSE 8 /* Domain is paused by controller software. */ -#define DF_SHUTDOWN 9 /* Guest shut itself down for some reason. */ -#define DF_CRASHED 10 /* Domain crashed inside Xen, cannot continue. */ -#define DF_DYING 11 /* Death rattle. */ -#define EDF_RUNNING 12 /* Currently running on a CPU. */ -#define EDF_CPUPINNED 13 /* Disables auto-migration. */ -#define EDF_MIGRATED 14 /* Domain migrated between CPUs. */ -#define EDF_DONEINIT 15 /* Initialization completed . */ - -static inline int domain_runnable(struct exec_domain *d) +#define EDF_BLOCKED 3 /* Domain is blocked waiting for an event. */ +#define EDF_CTRLPAUSE 4 /* Domain is paused by controller software. */ +#define EDF_RUNNING 5 /* Currently running on a CPU. */ +#define EDF_CPUPINNED 6 /* Disables auto-migration. */ +#define EDF_MIGRATED 7 /* Domain migrated between CPUs. */ +#define EDF_DONEINIT 8 /* Initialization completed . */ + +#define DF_CONSTRUCTED 0 /* Has the guest OS been fully built yet? */ +#define DF_IDLETASK 1 /* Is this one of the per-CPU idle domains? */ +#define DF_PRIVILEGED 2 /* Is this domain privileged? */ +#define DF_PHYSDEV 3 /* May this domain do IO to physical devices? */ +#define DF_SHUTDOWN 4 /* Guest shut itself down for some reason. */ +#define DF_CRASHED 5 /* Domain crashed inside Xen, cannot continue. */ +#define DF_DYING 6 /* Death rattle. */ + +static inline int domain_runnable(struct exec_domain *ed) { - return ( (atomic_read(&d->pausecnt) == 0) && - !(d->ed_flags & ((1<domain->d_flags & ((1<pausecnt) == 0) && + !(ed->flags & ((1<domain->flags & ((1<ed_flags) ) + if ( test_and_clear_bit(EDF_BLOCKED, &ed->flags) ) domain_wake(ed); } @@ -396,7 +399,7 @@ static inline void domain_pause_by_systemcontroller(struct domain *d) for_each_exec_domain ( d, ed ) { ASSERT(ed != current); - if ( !test_and_set_bit(EDF_CTRLPAUSE, &ed->ed_flags) ) + if ( !test_and_set_bit(EDF_CTRLPAUSE, &ed->flags) ) domain_sleep(ed); } @@ -409,14 +412,14 @@ static inline void domain_unpause_by_systemcontroller(struct domain *d) for_each_exec_domain ( d, ed ) { - if ( test_and_clear_bit(EDF_CTRLPAUSE, &ed->ed_flags) ) + if ( test_and_clear_bit(EDF_CTRLPAUSE, &ed->flags) ) domain_wake(ed); } } -#define IS_PRIV(_d) (test_bit(DF_PRIVILEGED, &(_d)->d_flags)) -#define IS_CAPABLE_PHYSDEV(_d) (test_bit(DF_PHYSDEV, &(_d)->d_flags)) +#define IS_PRIV(_d) (test_bit(DF_PRIVILEGED, &(_d)->flags)) +#define IS_CAPABLE_PHYSDEV(_d) (test_bit(DF_PHYSDEV, &(_d)->flags)) #define VM_ASSIST(_d,_t) (test_bit((_t), &(_d)->vm_assist)) -- 2.30.2